const http = require('http')
const hasha = require('hasha')

async function getHttpImageStream(link) {
  return new Promise((resolve) => http.get(link, resolve))
}

async function main() {
  const stream = await getHttpImageStream(
    'http://i-cdn.ibuka.cn/manga/cover/212787/201911201931/32x.jpg'
  )
  console.log(await hasha.fromStream(stream, { algorithm: 'md5' }))
}

main()
